# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=dhcpoptinj
pkgver=123.58a12c6
pkgrel=1
pkgdesc='DHCP option injector.'
groups=('blackarch' 'blackarch-networking')
arch=('x86_64' 'aarch64')
url='https://github.com/misje/dhcpoptinj'
license=('GPL3')
depends=('libnetfilter_queue')
makedepends=('git' 'cmake')
source=("git+https://github.com/misje/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  echo $(git rev-list --count HEAD).$(git rev-parse --short HEAD)
}

build() {
  cd $pkgname

  mkdir -p build

  cd build

  cmake ..

  make -j1
}

package() {
  cd $pkgname

  install -Dm 755 "build/$pkgname" "$pkgdir/usr/bin/$pkgname"
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" README.md
  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
}

